<?php
/**
 * do {ProjectID | TodoID}
 */
X::import('Application.Modles.Command');

class CDo extends Command {
	public function parserParamString($paramString){
		$this->arguments[0] = trim($paramString)*1;
		
		return $this;
	}
	
	public function run(){
		if ( XUser::STATUS_OFFLINE == X::app()->user->status ){
			$this->result->errno = XErrorCode::USER_OFFLINE ;
			$this->result->error = 'User offline';
			return $this;	
		}
		
		if ( !X::app()->session->has('CurrentProject') ){
			X::app()->session->CurrentProject = $this->arguments[0];
		}
		else{
			X::app()->session->CurrentTodo = $this->arguments[0];
		}
		
		return $this;
	}
}
?>